home *** CD-ROM | disk | FTP | other *** search
- /*
- grpplt.c
- */
-
- #include <stdio.h>
- #include <egb.h>
-
- #include <ryosuke.h>
- #include <usrlib.h>
-
- extern char *EGB_work;
-
- void grp_setplt(int plt, int rgb /* bit23-16:赤 bit15-8:緑 bit7-0:青 */)
- {
- char para[12];
- DWORD(para + 0) = 1;
- DWORD(para + 4) = plt;
- BYTE(para + 8) = ( rgb & 0xff );
- BYTE(para + 9) = ( (rgb >> 8) & 0xff );
- BYTE(para + 10) = ( (rgb >> 16) & 0xff );
- BYTE(para + 11) = 0;
- EGB_palette( EGB_work, 0, para );
- }
-
- int grp_getplt(int plt) /* ret: bit23-16:赤 bit15-8:緑 bit7-0:青 */
- {
- char pltdat[4+8*256], *p;
- int ret;
- EGB_getPalette( grp_getWrtpage(), pltdat );
- p = pltdat + 4 + 8 * plt + 4;
- ret = *p | ((int)*(p+1) << 16) | ((int)*(p+2) << 8);
- return ret;
- }
-
- /* end of grpplt.c */
-